cleaned up object creation code

some code was not where it belonged...