Refactored and rearranged some code