cleaned up code some more for consistency