Remove unnecessary boolean and function