Cleaned up code as requested by @dondi