Refactor Some stuff