cleaned up the code ..