def readlines_and_split_spaces(filepath):
    """
    Read lines from filepath and then split each line by
    whitespaces.
    """
    filelist = open(filepath).readlines()
    filelist = list(map(lambda x: list(x.strip().split(" ")), filelist))

    return filelist