Organized code a bit more