Cleaned up Code and moved method around