Reorganized the code again, will help avoid code duplication