reorganize to not do everything in constructor