Refactored planet code to be more extensible.