got rid of a function, resulting in small performance improvement. more code cleanup