moving drawing code to a separate source file.