Removed top-level  and moved all methods to top level.