Refactor code to remove unnecessary code

Some unnecessary code should be put off.