code reorganization and get ready for animals implementation

Signed-off-by: outram <outram@gmail.com>