moved entry point to bin, refactore variable declaration