Fixed warning for undeclared type.
Made build more generic, so it can be re-used in other projects