cleaned up dirty hack