Revert "code refactoring, cleanup, gitignore"

This reverts commit 26cf0522822a3cb8759d7d4de7634fbca3d11164.