cleaning up codes a bit