GH-5 Cleaned up code