cleaned up and organized methods