Fix for board drawing order helper + some refactoring