Cleaning up init function