cleans up code slightly